package leetcode.每日一题;

import org.junit.Test;

/**
 * @author ：zsy
 * @date ：Created 2022/12/14 8:07 PM
 * @description：
 */
public class 判断句子是否为全字母句 {
    @Test
    public void test() {
        System.out.println(new Solution().checkIfPangram("leetcode"));
    }

    class Solution {
        public boolean checkIfPangram(String sentence) {
            int length = sentence.length();
            int[] arr = new int[26];
            for (int i = 0; i < length; i++) {
                int idx = sentence.charAt(i) - 'a';
                arr[idx]++;
            }
            for (int a : arr) {
                if (a == 0) {
                    return false;
                }
            }
            return true;
        }
    }
}
